﻿using _19.备忘录模式.Interface;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _19.备忘录模式.Models
{
    public class GameState : IGameState
    {
        /// <summary>
        /// 等级
        /// </summary>
        public int Level { get; set; }

        /// <summary>
        /// 经验值
        /// </summary>
        public int Exp { get; set; }

        public Memo Create()
        {
            return new Memo(Level, Exp);
        }

        public void Restore(Memo memo)
        {
            Level = memo.Level;
            Exp = memo.Exp;
        }

        public void Display()
        {
            Console.WriteLine($"Level等级:{Level}");
            Console.WriteLine($"Exp经验值:{Exp}");
        }
    }
}
